package com.seguriapp.dialogs;

import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.seguriapp.R;
import com.seguriapp.adapters.LstCrimeAdapter;
import com.seguriapp.entities.CrimePointEntity;

/**
 * TODO(pjohnson): Insert description
 * 
 * @author Pablo Johnson (pablo.88j@gmail.com)
 */
public class CrimeDialog extends DialogFragment {

	private CrimePointEntity mItem;

	public CrimeDialog() {

	}

	public CrimeDialog(CrimePointEntity item) {
		this();
		mItem = item;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		final View view = inflater.inflate(R.layout.dialog_crime, container);

		getDialog().setTitle(
				getDialog().getContext().getString(R.string.msgEstadisticas));

		final ListView lstVCrimenes = (ListView) view
				.findViewById(R.id.lstCrimenes);
		final LstCrimeAdapter lstAdapter = new LstCrimeAdapter(getDialog()
				.getContext(), R.layout.list_crime_dialog, mItem.getListCrime());
		lstVCrimenes.setAdapter(lstAdapter);

		return view;
	}

}
